import request from '@/utils/request'

/**
 * 获取盘点列表
 * @param {*} param0
 */
export async function getCheckList({ current = 1, ...args }) {
  return request('/pd/findCheckList', {
    method: 'POST',
    data: {
      current,
      ...args,
    },
  })
}

/**
 * 盘点详情
 * @param {*} param0
 */
export async function getCheckDetail({ id }) {
  return request('/pd/findCheckById', {
    method: 'POST',
    data: {
      id,
    },
  })
}

/**
 * 删除盘点
 * @param {*} param0
 */
export async function delPropCheck({ ids }) {
  return request('/pd/delCheckById', {
    method: 'POST',
    data: {
      ids,
    },
  })
}

/**
 * 盘点更新
 * @param {*} params
 */
export async function updatePropCheck(params) {
  const url = params.id ? '/pd/updatePd' : '/pd/createPd'
  return request(url, {
    method: 'POST',
    data: params,
  })
}
